* This script contains the code to replicate Table A of the on-line appendix in Ductor, L., Fafchamps, M., Goyal S. and M. van der Leij. Social Networks and Research Output. The Review of Economics and Statistics.

log using TableA.log, replace
use prodndnp_fullsample.dta, clear

/*Selection: We require at least 10 observations per author.*/
bys auth: egen mt=max(t)
drop if mt<10
drop if year>1996


/*Panel Unit Root test: Harris & Tzavalis*/

bys auth: gen n=_n 
bys auth: egen mt2=max(n) 

set more off

/*TABLE A1*/
foreach i in 15 18 21 24 26 {
xtunitroot ht lprodf3 if mt2==`i'
}


foreach i in 15 18 21 24 26 {
xtunitroot ht degree5y if mt2==`i'
xtunitroot ht degree25y if mt2==`i'
xtunitroot ht lnetprod5y if mt2==`i'
xtunitroot ht lnetprod25y if mt2==`i'
xtunitroot ht lbet5y if mt2==`i'
xtunitroot ht gc5y if mt2==`i'
xtunitroot ht lclos5y if mt2==`i'
xtunitroot ht neiq15y if mt2==`i'
}
log close 
/*Rest of authors*/

/*1-year network period*/
foreach i in 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27{
xtunitroot ht lprodf3 if mt2==`i'
xtunitroot ht degree1y if mt2==`i'
xtunitroot ht degree21y if mt2==`i'
xtunitroot ht lnetprod1y if mt2==`i'
xtunitroot ht lnetprod21y if mt2==`i'
xtunitroot ht lbet1y if mt2==`i'
xtunitroot ht gc1y if mt2==`i'
xtunitroot ht lclos1y if mt2==`i'
xtunitroot ht neiq11y if mt2==`i'
}
/*5-year network period*/
foreach i in 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27{
xtunitroot ht lprodf3 if mt2==`i'
xtunitroot ht degree5y if mt2==`i'
xtunitroot ht degree25y if mt2==`i'
xtunitroot ht lnetprod5y if mt2==`i'
xtunitroot ht lnetprod25y if mt2==`i'
xtunitroot ht lbet5y if mt2==`i'
xtunitroot ht gc5y if mt2==`i'
xtunitroot ht lclos5y if mt2==`i'
xtunitroot ht neiq15y if mt2==`i'
}

/*10-year network period*/
foreach i in 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27{
xtunitroot ht degree10y if mt2==`i'
xtunitroot ht degree210y if mt2==`i'
xtunitroot ht lnetprod10y if mt2==`i'
xtunitroot ht lnetprod210y if mt2==`i'
xtunitroot ht lbet10y if mt2==`i'
xtunitroot ht gc10y if mt2==`i'
xtunitroot ht lclos10y if mt2==`i'
xtunitroot ht neiq110y if mt2==`i'
}
log close
